﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WMSSystem.Migrations
{
    /// <inheritdoc />
    public partial class 出库表 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<Guid>(
                name: "Quantitylistid",
                table: "AppInventoryDetails",
                type: "char(100)",
                maxLength: 100,
                nullable: false,
                comment: "数量变化表(外键)",
                collation: "ascii_general_ci",
                oldClrType: typeof(string),
                oldType: "char(100)",
                oldMaxLength: 100,
                oldComment: "数量变化表(外键)")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<Guid>(
                name: "Positionid",
                table: "AppInventoryDetails",
                type: "char(100)",
                maxLength: 100,
                nullable: false,
                comment: "库位Id(外键)",
                collation: "ascii_general_ci",
                oldClrType: typeof(string),
                oldType: "char(100)",
                oldMaxLength: 100,
                oldComment: "库位Id(外键)")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<Guid>(
                name: "Manager",
                table: "AppInboundmanagement",
                type: "char(50)",
                maxLength: 50,
                nullable: false,
                comment: "经办人(外键)",
                collation: "ascii_general_ci",
                oldClrType: typeof(string),
                oldType: "char(50)",
                oldMaxLength: 50,
                oldComment: "经办人(外键)")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppOutbound",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Code = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "出库编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Type = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "出库类型")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    State = table.Column<int>(type: "int", nullable: false, comment: "状态 1草稿 2待审核 3驳回 4已完成"),
                    Date = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "入库日期"),
                    Warehouseid = table.Column<Guid>(type: "char(36)", nullable: false, comment: "仓库名称(外籍)", collation: "ascii_general_ci"),
                    Inventorydetailsid = table.Column<Guid>(type: "char(36)", nullable: false, comment: "关联单号(外键)", collation: "ascii_general_ci"),
                    Inboundgoods = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "入库货品")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Manager = table.Column<Guid>(type: "char(50)", maxLength: 50, nullable: false, comment: "经办人(外键)", collation: "ascii_general_ci"),
                    Num = table.Column<int>(type: "int", nullable: true, comment: "入库数量"),
                    Price = table.Column<decimal>(type: "decimal(65,30)", nullable: true, comment: "入库金额"),
                    Vendor = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "供应商")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Contact = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "联系人")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Phone = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false, comment: "联系方式")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Remark = table.Column<string>(type: "longtext", nullable: true, comment: "备注")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    YUstring = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    YUstringtwo = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    YUstringone = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ExtraProperties = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppOutbound", x => x.Id);
                },
                comment: "出库")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AppOutbound");

            migrationBuilder.AlterColumn<string>(
                name: "Quantitylistid",
                table: "AppInventoryDetails",
                type: "char(100)",
                maxLength: 100,
                nullable: false,
                comment: "数量变化表(外键)",
                oldClrType: typeof(Guid),
                oldType: "char(100)",
                oldMaxLength: 100,
                oldComment: "数量变化表(外键)")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:Collation", "ascii_general_ci");

            migrationBuilder.AlterColumn<string>(
                name: "Positionid",
                table: "AppInventoryDetails",
                type: "char(100)",
                maxLength: 100,
                nullable: false,
                comment: "库位Id(外键)",
                oldClrType: typeof(Guid),
                oldType: "char(100)",
                oldMaxLength: 100,
                oldComment: "库位Id(外键)")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:Collation", "ascii_general_ci");

            migrationBuilder.AlterColumn<string>(
                name: "Manager",
                table: "AppInboundmanagement",
                type: "char(50)",
                maxLength: 50,
                nullable: false,
                comment: "经办人(外键)",
                oldClrType: typeof(Guid),
                oldType: "char(50)",
                oldMaxLength: 50,
                oldComment: "经办人(外键)")
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("Relational:Collation", "ascii_general_ci");
        }
    }
}
